package com.springboot.chatroom.service;


import com.springboot.chatroom.mapper.MessageSessionMapper;
import com.springboot.chatroom.model.Friend;
import com.springboot.chatroom.model.MessageSession;
import com.springboot.chatroom.model.MessageSessionUserItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description :
 * User: jiume
 * Date: 2025-04-14
 * Time: 10:11
 */
@Service
public class MessageSessionService {

    @Autowired
    private MessageSessionMapper messageSessionMapper;

    public List<Integer> getSessionIdsByUserId(Integer userId) {
        return messageSessionMapper.getSessionIdsByUserId(userId);
    }

    public List<Friend> getFriendsBySessionId(Integer sessionId, int userId) {
        return messageSessionMapper.getFriendsBySessionId(sessionId, userId);
    }

    public Integer addMessageSession(MessageSession messageSession) {
        return messageSessionMapper.addMessageSession(messageSession);
    }

    public Integer addMessageSessionUserItem(MessageSessionUserItem messageSessionUserItem) {
        return messageSessionMapper.addMessageSessionUserItem(messageSessionUserItem);
    }
}
